package com.zj.leetcode.easy.dynamicProgramming;

/**
 * @program: algorithm
 * @description:
 * 爬楼梯
 * 70 climbing-stairs
 * @author: Zhang Bo
 * @create: 2022-01-14 17:05
 **/
public class ClimbingStairs{
    public static void main(String[] args) {
        Solution solution = new ClimbingStairs().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public int climbStairs(int n) {

            int a = 0;
            int b = 1;
            for (int i = 1; i <= n; i++) {
                int temp = a;
                a = b;
                b = temp + a;
            }

            return b;

        }

    }
//leetcode submit region end(Prohibit modification and deletion)

}
